package cn.fay.chapter07;

public class Beetle extends Insect{

	private int k=printInit("beetle.k initialized");
	public Beetle()
	{
		System.out.println("k="+k);
		System.out.println("j="+j);
	}
	
	public static void main(String[] args) {
		System.out.println("beetle constructor");
		Insect b=new Beetle();
		b.sys();

	}
	private static int x2=printInit("static beetle.x2 initialized");
	public void sys()
	{
		System.out.println("beetle");
	}

}
class Insect
{
	private int i=9;
	protected int j;
	Insect(){
		System.out.println("i="+i+",j="+j);
		j=39;
	}
	private static int x1=printInit("static insect.x1 initialized");
	static int printInit(String s)
	{
		System.out.println(s);
		return 47;
	}
	public void sys(){
		
		System.out.println("insect");
	}
}